<!--
Date: 2025-08-13
Copyright (c) 2025 Industrial Software Feature Database
-->
<template>
  <!-- <el-card shadow="hover"> -->
  <div class="manned-load-table">
    <el-table v-loading="loading" :data="dataList" ref="tableRef">
        <el-table-column label="编号" prop="no"/>
        <el-table-column label="重量(kg)" prop="g"/>
        <el-table-column label="重心(m)" align="center">
          <el-table-column label="X" prop="x"></el-table-column>
          <el-table-column label="Y" prop="y"></el-table-column>
          <el-table-column label="Z" prop="z"></el-table-column>
        </el-table-column>
        <el-table-column label="惯量(kg*m2)" align="center">
          <el-table-column label="Ixx" prop="ixx"></el-table-column>
          <el-table-column label="Iyy" prop="iyy"></el-table-column>
          <el-table-column label="Ixz" prop="ixz"></el-table-column>
          <el-table-column label="Iyz" prop="iyz"></el-table-column>
          <el-table-column label="Ixy" prop="ixy"></el-table-column>
          <el-table-column label="Izz" prop="izz"></el-table-column>
        </el-table-column>
      </el-table>
      <div class="pagenation">
        <pagination
          v-show="total > 0"
          style="margin-top: 0;"
          v-model:page="queryParams.pageNum"
          v-model:limit="queryParams.pageSize"
          :total="total"
          :background="false"
          layout="total, sizes, prev, pager, next, jumper"
          @pagination="handleCurrentChange"
        />
      </div>
  </div>
    
  <!-- </el-card> -->
</template>
<script setup>
import { getMannedLoadList } from '@/api/mannedLoad';
const queryParams = ref({
  pageNum: 1,
  pageSize: 10
})
const dataList = ref([])
const total = ref(0)
const loading = ref(false)
const tableRef = ref(null)
// 列表查询
const getList = () => {
  // loading.value = true;
  getMannedLoadList(queryParams.value).then((res) => {
    const { rows } = res;
    dataList.value = rows;
    total.value = res?.total;
    // loading.value = false;
  })
} 

// 翻页
const handleCurrentChange = () => {
  getList();
};
// 创建 VTable 实例
onMounted(async ()=>{
  getList();  
})

</script>
<style lang="scss" scoped>
.manned-load-table {
  // height: calc(100vh - 155px);
  overflow: auto;
  .tiltops {
    color: red;
  }
  .pagenation {
    display: flex;
    justify-content: end;
    margin-top: 10px;
  }
}
</style>